<!DOCTYPE html>
<html	xmlns:th="https://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>管理员登录</title>
<script type="text/javascript" th:src="@{/bootstrap3/js/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap3/js/jquery.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap3/js/bootstrap.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap3/js/bootstrap.min.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap3/js/npm.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap3/js/popper.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap3/js/popper.min.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap3/js/bootstrap-popover.js}"></script>
<link rel="stylesheet" type="text/css" th:href="@{/bootstrap3/css/bootstrap-theme.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/bootstrap3/css/bootstrap.css}" />
<link rel="stylesheet" type="text/css" th:href="@{/bootstrap3/css/bootstrap-theme.min.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/bootstrap3/css/bootstrap.min.css}" />
</head>
<script type="text/javascript">
	function checklogin(){
		var username = $("#username").val();
		var password = $("#password").val();
		if(username==""||password==""){
			document.getElementById("adminlogin_tip").innerHTML = '<div style="color:whitesmoke;">输入的数据不是合法数据</div>';
		}else{
			$.ajax({
				type:"post",
				url:"checkadminLogin",
				async:true,
				data:{username:username,password:password},
				dataType:"json",
				success:function(data){
					if(data==2){
						document.getElementById("adminlogin_tip").innerHTML = '<div style="color:whitesmoke;">账号不存在，亦或者密码错误</div>';
					}else if(data==1){
						window.location.href="goadminindex";
					}else{
						window.alert("系统内部故障");
					}
				},
				error:function(){
					window.alert("系统内部故障");
				}
			});
		}
	}
	function forgetpwd(){
		window.alert("小码农一不小心忘记了开发这个功能，紧急修bug中....");
	}
</script>
<body>
<!--背景-->
<img th:src="@{/img/bg.gif}" style="z-index: -100;height: 100%;width: 100%;position: absolute;left: 0px;top: 0px;" />
<div class="container-fluid">
	<div class="row">
		<div class="col-sm-4"></div>
		<div class="col-sm-4">
			<div class="panel" style="background-color: rgba(255,255,255,0.4);height: 450px;margin-top: 80px;">
				<div class="panel-body">
					<form>
						<div class="form-group text-center" style="font-family: STXingkai;font-size: x-large;">
							广二师大酒店后台管理系统
						</div>
						<div class="form-group">
							<label for="username">用户名：</label>
							<input id="username" class="form-control" type="text" placeholder="请输入管理员专用名" maxlength="20"/>
						</div>
						<div class="form-group">
							<label for="password">密&nbsp;&nbsp;&nbsp;&nbsp;码：</label>
							<input id="password" class="form-control" type="password" />
						</div>
						<div class="form-group" style="height: 8px;">
							<div id="adminlogin_tip" class="text-center"></div>
						</div>
						<div class="form-group">
							<a href="javascript:void(0)" onclick="checklogin()" class="form-control btn btn-info">登录</a>
						</div>
						<div class="form-group text-right">
							<a href="javascript:void(0)" style="color: white;" onclick="forgetpwd()">忘记密码？</a>
						</div>
					</form>
				</div>
			</div>
		</div>
		<div class="col-sm-4"></div>
	</div>
</div>
</body>
</html>
